﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Geldtransporter
{
    class BagStack
    {
        private BindingList<MoneyBag> bagList = new BindingList<MoneyBag>();

        public BindingList<MoneyBag> BagList
        {
          get { return bagList; }
          set { bagList = value; }
        }

        public int TotalMoney()
        {
            int ret = 0;

            foreach (var item in bagList)
	        {
		        ret = ret + item.Money;  
	        }

            return ret;
        }

        public int TotalWeight()
        {
            int ret = 0;

            foreach (var item in bagList)
	        {
		        ret = ret + item.Weight;              

	        }

            return ret;
        }

        public void Add(MoneyBag bag)
        {
            this.bagList.Add(bag);
        }       

    }
}
